/**
 * @author Emporeo
 * @web http://www.fai-communication.de/accountManager
 * @web source: http://code.google.com/p/mmo-account-manager/
 */

package acm.log4j.servlet;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class Log4jInit extends HttpServlet {

private static final long serialVersionUID = 1L;

public
  void init() {
//	 Logger initialisieren
	String prefix =  getServletContext().getRealPath("/");
	
    String l4jFile = getInitParameter("log4j");
    // if the log4j-init-file is not set, then no point in trying
    if(l4jFile != null) {
      PropertyConfigurator.configure(prefix+l4jFile);
      Logger logger = Logger.getLogger( this.getClass());
	  logger.info(  "*** Log4j logging initialized ***"  );
	    //logger.info(  prefix  );
    }
  }

  public
  void doGet(HttpServletRequest req, HttpServletResponse res) {
  }
}

